<?php

namespace easydis\APSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * UO
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="easydis\APSBundle\EntityRepository\UORepository")
 */
class UO
{
    /**
     * @var string
     *
     * @ORM\Column(name="date", type="string", length=30)
     * @ORM\Id
     */
    private $date;
    
    /**
     * @var date
     *
     * @ORM\Column(name="date_eng", type="date")
     */
    private $date_eng;

    /**
     * @var integer
     *
     * @ORM\Column(name="uoprev", type="integer")
     */
    private $uoprev;

    /**
     * @var integer
     *
     * @ORM\Column(name="uoobj", type="integer")
     */
    private $uoobj;

    /**
     * @var integer
     *
     * @ORM\Column(name="uoreel", type="integer")
     */
    private $uoreel;

    /**
     * @ORM\ManyToOne(targetEntity="easydis\APSBundle\Entity\Service")
     * @ORM\JoinColumn(nullable=false)
     * @ORM\Id
     */
     private $service;

        
     public function __construct($date, $s) {
        $this->date = $date;
        $this->service = $s;
        $this->uoprev = 0;
        $this->uoobj = 0;
        $this->uoreel = 0;
        
        $this->date_eng = date_create_from_format('d/m/Y', $date);
    }   
        
        
    /**
      * Set service
      *
      * @param easydis\APSBundle\Entity\Service $service
      */
    public function setService(\easydis\APSBundle\Entity\Service $service)
    {
            $this->service = $service;
    }

    /**
      * Get service
      *
      * @return easydis\APSBundle\Entity\Service 
      */
    public function getService()
    {
        return $this->service;
    }
	
    /**
     * Get date
     *
     * @return string 
     */
    public function getDate()
    {
        return $this->date;
    }
    
    /**
     * Get date_eng
     *
     * @return date
     */
    public function getDate_eng()
    {
        return $this->date_eng;
    }

    /**
     * Set uoprev
     *
     * @param integer $uoprev
     * @return UO
     */
    public function setUoprev($uoprev)
    {
        $this->uoprev = $uoprev;
    
        return $this;
    }

    /**
     * Get uoprev
     *
     * @return integer 
     */
    public function getUoprev()
    {
        return $this->uoprev;
    }

    /**
     * Set uoobj
     *
     * @param integer $uoobj
     * @return UO
     */
    public function setUoobj($uoobj)
    {
        $this->uoobj = $uoobj;
    
        return $this;
    }

    /**
     * Get uoobj
     *
     * @return integer 
     */
    public function getUoobj()
    {
        return $this->uoobj;
    }

    /**
     * Set uoreel
     *
     * @param integer $uoreel
     * @return UO
     */
    public function setUoreel($uoreel)
    {
        $this->uoreel = $uoreel;
    
        return $this;
    }

    /**
     * Get uoreel
     *
     * @return integer 
     */
    public function getUoreel()
    {
        return $this->uoreel;
    }
}
